package business.search_eng;

import business.search_eng.scorer.WeightedScorer;

public class ResultListItem implements Comparable<ResultListItem> {

	public double score;
	public String documentId;
	
	public WeightedScorer scorer;
	
	public ResultListItem(String documentId, Double score) {
		this.documentId = documentId;
		this.score = score;
	}
	
	public ResultListItem(String documentId) {
		this.documentId = documentId;
		//this.scorer = new WeightedScorer();
	}

	@Override
	public int compareTo(ResultListItem o) {
		double rest = this.score + (o.score * -1);
		if(rest <= 0) {
			if(rest <0) {
				return 1;
			} else  {
				return 0;
			}
		} else {
			return -1;
		}
	}
}
